package org.example.utils.post.post.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.dao.entity.post.PPost;

/**
 * @author 22449
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EsPostSearchDoc {

    private String content;
    private Integer hot;
    private Long themeId;

    public EsPostSearchDoc(PPost post){
        content = post.getContent();
        themeId = post.getThemeId();
        hot = post.getLikeNum()*10 + post.getBrowseNum() + post.getClickNum()*5 + post.getTransmitNum()*20;
    }

}
